﻿using System;
using Microsoft.Xna.Framework;

namespace XNAGameEngine.GameState
{
    /// <summary>
    /// Interface between a GameStateObject and the GameStateManager
    /// </summary>
    public interface IManagerGameState
    {
        #region properties

        /// <summary>
        /// Returns the GameEngine from the GameStateManager
        /// </summary>
        Game Game { get; }

        /// <summary>
        /// Gets the string reference of the current state
        /// </summary
        string GetCurrentStateName { get; }

        /// <summary>
        /// Gets whether or not the current state is in its active state
        /// </summary>
        bool IsCurrentStateActive { get; }

        #endregion

        #region methods

        /// <summary>
        /// Called by StateObjects to reset the engine back to the initial state
        /// </summary>
        void ResetEngine();

        /// <summary>
        /// Called by StateObjects to change the engine to a new state
        /// </summary>
        /// <param name="newState">string value of the new state</param>
        void ChangeState(string newState);

        /// <summary>
        /// Called by StateObjects to change the engine to a new state, using a different transition
        /// </summary>
        /// <param name="newState">string value of the new state</param>
        /// <param name="transition">string value of the transition to use</param>
        void ChangeState(string newState, string transition);

        /// <summary>
        /// Called by StateObjects to cleanup and shut down the state engine
        /// </summary> 
        void ShutdownEngine();

        /// <summary>
        /// Registers an object type with an string value. The first state registered
        /// will automatically be assigned to the intial state. This can be changed with the
        /// "SetInitialState() call"
        /// </summary>
        /// <param name="key">the string value to register with the object type</param>
        /// <param name="value">the object type to register with the string value</param>
        void RegisterGameState(string key, Type value);

        /// <summary>
        /// Registers an GameStateTransition object type with a string value. 
        /// </summary>
        /// <param name="key">the string to register with the object type</param>
        /// <param name="value">the object type to register with the string</param>
        void RegisterGameStateTransition(string key, Type value);

        /// <summary>
        /// Set the state the game loads when started up and reset
        /// </summary>
        /// <param name="key">the string value registered to the intial state</param>
        void SetInitialState(string key);

        #endregion
    }
}